package cn.dnuihyy406.dnuifood_16110100406.model;


import cn.dnuihyy406.dnuifood_16110100406.bean.ResultBean;
import cn.dnuihyy406.dnuifood_16110100406.bean.UserBean;
import cn.dnuihyy406.dnuifood_16110100406.iface.UserIface;
import cn.dnuihyy406.dnuifood_16110100406.listener.OnRetrofitListener;
import cn.dnuihyy406.dnuifood_16110100406.service.UserService;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

public class UserModel extends BaseModel implements UserIface {
    private UserService service;
    public UserModel(){
        super();
        service = retrofit.create(UserService.class);
    }

    @Override
    public void login(String username, String userpass, final OnRetrofitListener listener) {
        Call call =service .doLogin(username,userpass);
        bindCallBack(call,listener,2);
    }

    //注册
    @Override
    public void reg(String username, String userpass, String mobilenum, String address, String comment,
                    final OnRetrofitListener listener) {
        Call call =service.doRegister(username,userpass,mobilenum,address,comment);
        bindCallBack(call,listener,3);
    }
}

